<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php session_start();
$Emails=$_POST['pusername'];
$link = mysql_connect('cash2uca.ipagemysql.com', 'cash2uca', 'actW3740!@#$'); 
if (!$link) { 
    die('Could not connect: ' . mysql_error()); 
} 
mysql_select_db(cash2uca);
$sql = "SELECT UserName , UserPWD,ProfileID FROM MainTable WHERE UserName= '$_POST[pusername]'";
$sqlresult=mysql_query($sql);
$row = mysql_fetch_array($sqlresult);
$_SESSION['username']=$row['UserName'];
$_SESSION['usrpwd']=$row['UserPWD'];
$_SESSION['ProfileID']=$row['ProfileID'];


if($_POST['newpwd']!=$_POST['cnewpwd'])
{echo "Sorry, your confirmed password is not the same as your password";
exit();
}

if($_SESSION['username']!=$_POST['pusername']||$_SESSION['usrpwd']!=md5($_POST['newpwd']))
{echo "Sorry, your username and password are not matched in our system";
exit();
}

$sqlp = "SELECT FirstName, LastName, Gender, BirthDate, Address, City, Province, PostCode, DateIn, PrimaryPhone, WorkPhone, CellPhone, Email, Advertisement, SIN, DriverLicense, R1Name, R2Name, R1Phone, R2Phone, R1Relation FROM Profiles WHERE ProfileID= '".$_SESSION['ProfileID']."'";
$sqlPR=mysql_query($sqlp);
$row = mysql_fetch_array($sqlPR);
$FirstName=$row['FirstName'];
$LastName=$row['LastName'];
$Gender=$row['Gender'];
$BirthDate=$row['BirthDate'];
$Address=$row['Address'];
$City=$row['City'];
$Province=$row['Province'];
$PostCode=$row['PostCode'];
$DateIn=$row['DateIn'];
$PrimaryPhone=$row['PrimaryPhone'];
$WorkPhone=$row['WorkPhone'];
$CellPhone=$row['CellPhone'];
$Email=$row['Email'];
$Advertisement=$row['Advertisement'];
$SIN=$row['SIN'];
$DriverLicense=$row['DriverLicense'];
$R1Name=$row['R1Name'];
$R2Name=$row['R2Name'];
$R1Phone=$row['R1Phone'];
$R2Phone=$row['R2Phone'];
$R1Relation=$row['R1Relation'];

?>

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Cash2u.ca: Payday loan online application processing</title>
<META NAME="Keywords" CONTENT="payday loan, payday cash advance, online, payday advance, payday cash loan, payday loans, cash advance, paycheque loans, short term,
	money mart, money here, quick cash,check,cashing,easy,tax, bill,payment,currency,card,credit,Easy Cash Advances, Internet Payday loans, Payroll Advance, Payday Loan Services,
	Online Payday Advances, Online Payday Loan Provider, Pay Day, Canada">
<META NAME="Description" CONTENT=Cash2u.ca offers online payday loans and cash advance for Canadians">

<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js"></script>
<script src="/css/jquery.maskedinput.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="/css/main_style.css"/>
<link rel="stylesheet" type="text/css" href="/css/index.css"/>
<script src="formavalidates.js" type="text/javascript"></script> 
<style type="text/css">@import "/css/jquery.datepick.css";</style>
<script type="text/javascript" src="/css/jquery.datepick.js"></script>
<script type="text/javascript">
$(function() {
	$('#datebirth').datepick({yearRange: '1900:+1'});
	$('#datein').datepick({yearRange: '1900:+1'});
});
function showDate(date) {
	alert('The date chosen is ' + date);
}
</script>
</head>
<body onload="DoMath()">
<div id="maincontainer">

<div id="headsection">
<div id="headback">
<br/><br/><br/><h1><a style="color:white;" href="apply.php">Cash to you</a></h1><p id="headpara"><a style="color:white;" href="apply.php">Simple Easy Fast - Your payday loan</a></p>
</div>
</div>

<table cellspacing="4" cellpadding="1" border="0" style="margin:5px;height:50px;width:740px;background-color:#084c8d;border:1px solid #e5e5e5;color:white;font-size:110%;font-weight:bold;">
<tr><td width="20"></td>
<td width="90" align="center"><a class="headlink" href="index.html">HOME</a></td>
<td width="90" align="center"><a class="headlink" href="apply.php">APPLY</a></td>
<td width="130" align="center"><a class="headlink" href="member.php"><span class="displace">MEMBERS</span></a></td>
<td width="110" align="center"><a class="headlink" href="career.php"><span class="displace">CAREER</span></a></td>
<td width="90" align="center"><a class="headlink" href="faqs.php"><span class="displace">FAQ's</span></a></td>
<td width="90" align="center"><a class="headlink" href="contact.php"><span class="displace">CONTACT</span></a></td>
<td width="140"></td>
</tr>
</table>

<div id="content">
    	<div id="Apphead" class="Apphead" style="margin: 20px 0 0 5px;">
        	<h3>Profile Updates</h3>
		<p>Returning customers, please <a style="color:green;" href="member.php">apply here</a> for a faster application<br/>
		   Please fill all the fields you want to update </p>
            
    	</div>
        <!-- EOD of Application Head -->    
          
        <div id="TopSectionWrapper" class="PersonalInfo">

	<!--Starting of Personal Information Section-->
	<div id="TitleInfo" class="TitleInfo"><h2>Your Personal Information Updating Section</h2></div>
	<form name="uProfiles" method="post" action="updatingnow.php" id="Profiles">
	<table cellspacing="4" cellpadding="1" border="0" style="margin: 0 0 0 0;">
		<tr>
                <td width="140" align="right">First Name:</td>
                <td width="170"><input type="text" style="width: 150px;" value="<?php echo $FirstName;?>" name="fName"></td>
                <td width="230" align="right">Last Name:</td>
                <td width="160"><input type="text" style="width: 150px;" name="lName" value="<?php echo $LastName;?>"></td>
		</tr>
		<tr>
                <td width="140" align="right">Gender:</td>
                <td width="170">
		<select style="width: 130px;" name="gender">
		<option value="" <?php if($Gender == "") {echo "selected='selected'";}; ?>>- Select -</option>
		<option value="female" <?php if($Gender == "female") {echo "selected='selected'";}; ?>>female</option>
		<option value="male" <?php if($Gender == "male") {echo "selected='selected'";}; ?>>male</option>
			</select>
                <td width="230" align="right">Social Insurance Number:<br/><span style="color:green;font-size:small;">(SIN: 999-999-999)</span></td>
                <td width="160"><input type="text" style="width: 150px;" id="ssn" name="SIN" value="<?php echo $SIN;?>"></td>
		</tr>
				
		<tr>
                <td width="140" align="right">Date of Birth:<br/><span style="color:green;font-size:small;">(date: mm/dd/yyyy)</span></td>
                <td width="170"><input type="text" id="datebirth" value="<?php echo $BirthDate;?>" style="width: 150px;" name="birthdate"/></td>
                <td width="230" align="right">Address:</td>
                <td width="160"><input type="text" style="width: 150px;" name="address" value="<?php echo $Address;?>"></td>
		</tr>

		<tr>
                <td width="140" align="right">City:</td>
                <td width="170"><input type="text" style="width: 150px;" value="<?php echo $City;?>" name="city"/></td>
                <td width="230" align="right">Province:</td>
                <td width="160">
		<select style="width: 150px;" name="mprovince">
		<option value="" <?php if($Province == "") {echo "selected='selected'";}; ?>>Please Select your province</option>
                <option value="Alberta" <?php if($Province == "Alberta") {echo "selected='selected'";}; ?>>Alberta</option>
                <option value="British Columbia" <?php if($Province == "British Columbia") {echo "selected='selected'";}; ?>>British Columbia</option>
                <option value="Manitoba" <?php if($Province == "Manitoba") {echo "selected='selected'";}; ?>>Manitoba</option>
                <option value="New Brunswick" <?php if($Province == "New Brunswick") {echo "selected='selected'";}; ?>>New Brunswick</option>
                <option value="Newfoundland" <?php if($Province == "Newfoundland") {echo "selected='selected'";}; ?>>Newfoundland</option>
                <option value="Northwest Territories" <?php if($Province == "Northwest Territories") {echo "selected='selected'";}; ?>>Northwest Territories</option>
                <option value="Nova Scotia" <?php if($Province == "Nova Scotia") {echo "selected='selected'";}; ?>>Nova Scotia</option>
                <option value="Nunavut" <?php if($Province == "Nunavut") {echo "selected='selected'";}; ?>>Nunavut</option>
                <option value="Ontario" <?php if($Province == "Ontario") {echo "selected='selected'";}; ?>>Ontario</option>
                <option value="Prince Edward Island" <?php if($Province == "Prince Edward Island") {echo "selected='selected'";}; ?>>Prince Edward Island</option>
                <option value="Saskatchewan" <?php if($Province == "Saskatchewan") {echo "selected='selected'";}; ?>>Saskatchewan</option>
                <option value="Yukon" <?php if($Province == "Yukon") {echo "selected='selected'";}; ?>>Yukon</option>
                </select></td>
		</tr>

		<tr>
                <td width="140" align="right">Post Code:<br/><span style="color:green;font-size:small;">(Post Code:A9A-9A9)</span></td>
                <td width="170"><input type="text" id="post" value="<?php echo $PostCode;?>" name="postcode" style="width: 150px;"/></td>
                <td width="230" align="right">When did you move in:<br/><span style="color:green;font-size:small;">(Date: mm/dd/yyyy)</span></td>
                <td width="160"><input type="text" id="datein" style="width: 150px;" name="datein" value="<?php echo $DateIn;?>"></td>
		</tr>

		<tr>
                <td width="140" align="right">Primary Phone:<br/><span style="color:green;font-size:small;">(Tel: (999) 999-9999)</span></td>
                <td width="170"><input type="text" id="phonep"  value="<?php echo $PrimaryPhone;?>" name="primaryphone" style="width: 150px;"/></td>
                <td width="230" align="right">Work Phone:<br/><span style="color:green;font-size:small;">(Tel: (999) 999-9999x99999)</span></td>
                <td width="160"><input type="text" id="phonew"  name="workphone" style="width: 150px;" value="<?php echo $WorkPhone;?>"></td>
		</tr>

		<tr>
                <td width="140" align="right">Cell Phone <span style="color:green;font-size:small;">(optional):<br/>(Tel: (999) 999-9999)</span></td>
                <td width="170"><input type="text" id="phonec" value="<?php echo $CellPhone;?>" name="cellphone" style="width: 150px;"/></td>
                <td width="230" align="right">Driver License/Health Card #:</td>
                <td width="160"><input type="text" name="driver" style="width: 150px;" value="<?php echo $DriverLicense;?>"></td>
		</tr>

		<tr>
                <td width="140" align="right">Email Address:<br/><span style="color:green;font-size:small;">(LoginID)</span></td>
                <td width="170"><input type="text" value="<?php echo $Email;?>" name="email" style="width: 150px;"/></td>
                <td width="230" align="right">Confirm Email Address:</td>
                <td width="160"><input type="text" name="cemail" style="width: 150px;" value="<?php echo $Email;?>"></td>
		</tr>
		
		
		<tr>
                <td width="140" align="right">Reference #1 Name:</td>
                <td width="170"><input type="text" value="<?php echo $R1Name;?>" name="r1name" style="width: 150px;"/></td>
                <td width="230" align="right">Reference #2 Name:<br/><span style="color:green;font-size:small;">(optional)</span></td>
                <td width="160"><input type="text" name="r2name" style="width: 150px;" value="<?php echo $R2Name;?>"></td>
		</tr>
		
		<tr>
                <td width="140" align="right">Reference #1 Phone:<br/><span style="color:green;font-size:small;">(required)</span></td>
                <td width="170"><input type="text" id="phoner1"  value="<?php echo $R1Phone;?>" name="r1phone" style="width: 150px;"/><br/><span style="color:green;font-size:small;">(Tel: (999) 999-9999 x 99999)</span></td>
                <td width="230" align="right">Reference #2 Phone (optional):<br/><span style="color:green;font-size:small;">(Tel: (999) 999-9999x99999)</span></td>
                <td width="160"><input type="text" id="phoner2"  name="r2phone" style="width: 150px;" value="<?php echo $R2Phone;?>"></td>
		</tr>


		<tr>
                <td width="140" align="right">Relationship :<br/><span style="color:green;font-size:small;">(with Reference  #1)</span></td>
                <td width="170"><input type="text" name="r1relation" value="<?php echo $R1Relation;?>" style="width: 150px;"/></td>
                <td width="230" align="right">Where did you know:<br/><span style="color:green;font-size:small;">(www.cash2u.ca)</span></td>
                <td width="160"><input type="text" style="width: 150px;" readonly name="advertisement" value="<?php echo $Advertisement;?>"/></td>
		</tr>
	</table>	
	
<!--for submit button-->
	<table>	
	<tr><td width="700" align="center"><input type="submit" value=" &nbsp;Submit"/></td>
		</tr>

</table>
	</form>
<script src="/css/UpdateProfiles.js" type="text/javascript"></script>	

<div id="footer">
<div id="imlinks"><b><strong>Copyright &#169 2011 Cash2u.ca All rights reserved</strong></b></div>
</div>

</div>

</body>
</html>